﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PSUA_RideSharing.ORM;

namespace PSUA_RideSharing.Pages.Registration
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          

        }

        protected void btnRegister_Click(object sender, EventArgs e)
        {
            using (RideShareEntities1 db = new RideShareEntities1())
            {
                tblMember newUser = new tblMember();

                newUser.fldName = txtBoxName.Text;
                newUser.fldUserID = txtBoxUserName.Text;
                newUser.fldPassword = txtBoxPassword.Text;
                newUser.fldEmail = txtBoxEmail.Text;
                newUser.fldZipCode = txtBoxZipCode.Text;
                db.tblMembers.Add(newUser);
                db.SaveChanges();

                txtBoxName.Text = "";
                txtBoxEmail.Text = "";
                txtBoxUserName.Text = "";
                txtBoxZipCode.Text = "";
                CreateAccountPanel.Visible = false;
                AccountCreatedPanel.Visible = true;


            }
        }


    }
}